<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>添加账号</title>
    <link rel="shortcut icon" href="favicon.ico">
    <link href="/static/admin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/static/admin/css/bootstrap-select.min.css" rel="stylesheet">
    <link href="/static/admin/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="/static/admin/css/animate.min.css" rel="stylesheet">
    <link href="/static/admin/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="/static/admin/css/style.min.css?v=4.1.0" rel="stylesheet">
    <!-- Sweet Alert -->
    <link href="/static/admin/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-8">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>添加账号</h5>
                    <div class="ibox-tools">
                        <a class="collapse-link">
                            <i class="fa fa-chevron-up"></i>
                        </a>
                        <a class="dropdown-toggle" data-toggle="dropdown" href="form_basic.html#">
                            <i class="fa fa-wrench"></i>
                        </a>
                        <a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>
                    </div>
                </div>
                <div class="ibox-content container-fluid">
                    <nav class="navbar navbar-inverse" role="navigation">
                        <ul class="nav navbar-nav">
                            <li class="active"><a data-toggle="tab" href="#wx">微信</a></li>
                            <li><a data-toggle="tab" href="#weibo">微博</a></li>
                            <li><a data-toggle="tab" href="#app">APP客户端</a></li>
                        </ul>
                    </nav>
                    <div class="tab-content">
                        <div id="wx" class="tab-pane fade in active">
                            <form class="form-horizontal m-t" id="commentWxForm" enctype="multipart/form-data" method="post" onsubmit="return toWxVaild()">

                                <div class="form-group">
                                    <label class="col-sm-3 control-label">公众号名称：</label>
                                    <div class="input-group col-sm-4">
                                        <input type="text" class="form-control" name="wxname" required="required" aria-required="true">
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-3 control-label">公众号头像：</label>
                                    <div class="input-group col-sm-4">
                                        <input type="file" class="form-control" name="wxlogo" required="required" aria-required="true">
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-3 control-label">微信号：</label>
                                    <div class="input-group col-sm-4">
                                        <input type="text" class="form-control" name="wxid" required="required" aria-required="true">
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-3 control-label">认证信息：</label>
                                    <div class="input-group col-sm-4">
                                        <input type="text" class="form-control" name="wxinfo" required="required" aria-required="true">
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-3 control-label">粉丝数：</label>
                                    <div class="input-group col-sm-4">
                                        <input type="text" class="form-control" name="wxfans" required="required" aria-required="true">
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-3 control-label">平均阅读量：</label>
                                    <div class="input-group col-sm-4">
                                        <input type="text" class="form-control" name="wxread" required="required" aria-required="true">
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-3 control-label">渠道联系人：</label>
                                    <div class="input-group col-sm-4">
                                        <input type="text" class="form-control" name="wxcontact" required="required" aria-required="true">
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-3 control-label">公众号类型：</label>
                                    <div class="input-group col-sm-4">
                                        <select id="wxtype" name="wxtype" class="selectpicker show-tick form-control"  data-live-search="false">
                                            <option value="民生">民生</option>
                                            <option value="房产">房产</option>
                                            <option value="金融">金融</option>
                                            <option value="体育">体育</option>
                                            <option value="汽车">汽车</option>
                                            <option value="乐活">乐活</option>
                                            <option value="美食">美食</option>
                                            <option value="健康">健康</option>
                                            <option value="科技">科技</option>
                                            <!--<option value="时事">时事</option>-->
                                            <!--<option value="民生">民生</option>-->
                                            <!--<option value="财富">财富</option>-->
                                            <!--<option value="科技">科技</option>-->
                                            <!--<option value="创业">创业</option>-->
                                            <!--<option value="汽车">汽车</option>-->
                                            <!--<option value="楼市">楼市</option>-->
                                            <!--<option value="职场">职场</option>-->
                                            <!--<option value="教育">教育</option>-->
                                            <!--<option value="学术">学术</option>-->
                                            <!--<option value="政务">政务</option>-->
                                            <!--<option value="企业">企业</option>-->
                                            <!--<option value="文化">文化</option>-->
                                            <!--<option value="百科">百科</option>-->
                                            <!--<option value="健康">健康</option>-->
                                            <!--<option value="时尚">时尚</option>-->
                                            <!--<option value="美食">美食</option>-->
                                            <!--<option value="乐活">乐活</option>-->
                                            <!--<option value="旅行">旅行</option>-->
                                            <!--<option value="幽默">幽默</option>-->
                                            <!--<option value="情感">情感</option>-->
                                            <!--<option value="体娱">体娱</option>-->
                                            <!--<option value="美体">美体</option>-->
                                            <!--<option value="文摘">文摘</option>-->
                                        </select>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-3 control-label">公众号地区：</label>
                                    <div class="input-group col-sm-4">
                                        <select id="area" name="area" class="selectpicker show-tick form-control"  data-live-search="false">
                                            <option value="浙江">浙江</option>
                                            <!--<option value="上海">上海</option>-->
                                            <!--<option value="北京">北京</option>-->
                                            <!--<option value="天津">天津</option>-->
                                            <!--<option value="重庆">重庆</option>-->
                                            <!--<option value="香港">香港</option>-->
                                            <!--<option value="澳门">澳门</option>-->
                                            <!--<option value="河北">河北</option>-->
                                            <!--<option value="山西">山西</option>-->
                                            <!--<option value="辽宁">辽宁</option>-->
                                            <!--<option value="吉林">吉林</option>-->
                                            <!--<option value="黑龙江">黑龙江</option>-->
                                            <!--<option value="江苏">江苏</option>-->
                                            <!--<option value="安徽">安徽</option>-->
                                            <!--<option value="福建">福建</option>-->
                                            <!--<option value="江西">江西</option>-->
                                            <!--<option value="山东">山东</option>-->
                                            <!--<option value="河南">河南</option>-->
                                            <!--<option value="湖北">湖北</option>-->
                                            <!--<option value="湖南">湖南</option>-->
                                            <!--<option value="广东">广东</option>-->
                                            <!--<option value="海南">海南</option>-->
                                            <!--<option value="四川">四川</option>-->
                                            <!--<option value="贵州">贵州</option>-->
                                            <!--<option value="云南">云南</option>-->
                                            <!--<option value="陕西">陕西</option>-->
                                            <!--<option value="甘肃">甘肃</option>-->
                                            <!--<option value="青海">青海</option>-->
                                            <!--<option value="台湾">台湾</option>-->
                                            <!--<option value="内蒙古">内蒙古</option>-->
                                            <!--<option value="广西">广西</option>-->
                                            <!--<option value="西藏">西藏</option>-->
                                            <!--<option value="宁夏">宁夏</option>-->
                                            <!--<option value="新疆">新疆</option>-->
                                        </select>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <div class="col-sm-4 col-sm-offset-3">
                                        <button class="btn btn-primary" type="submit">提交</button>
                                        <button class="btn btn-danger" onclick="javascript:window.history.back(); return false;">取消</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                        <div id="weibo" class="tab-pane fade"></div>
                        <div id="app" class="tab-pane fade"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="/static/admin/js/jquery.min.js?v=2.1.4"></script>
<script src="/static/admin/js/bootstrap-select.min.js"></script>
<script src="/static/admin/js/bootstrap.min.js?v=3.3.6"></script>
<script src="/static/admin/js/content.min.js?v=1.0.0"></script>
<script src="/static/admin/js/plugins/validate/jquery.validate.min.js"></script>
<script src="/static/admin/js/plugins/validate/messages_zh.min.js"></script>
<script src="/static/admin/js/plugins/iCheck/icheck.min.js"></script>
<script src="/static/admin/js/plugins/sweetalert/sweetalert.min.js"></script>
<script src="/static/admin/js/plugins/layer/laydate/laydate.js"></script>
<script src="/static/admin/js/plugins/suggest/bootstrap-suggest.min.js"></script>
<script src="/static/admin/js/plugins/layer/layer.min.js"></script>
<script type="text/javascript">
    //表单提交
    function toWxVaild(){
        var jz;
        var url = "./accountAdd";
        $.ajax({
            type:"POST",
            url:url,
            cache: false,
            data: new FormData($('#commentWxForm')[0]),
            processData: false,
            contentType: false,
            beforeSend:function(){
                jz = layer.load(0, {shade: false}); //0代表加载的风格，支持0-2
            },
            error: function(request) {
                layer.close(jz);
                swal("网络错误!", "", "error");
            },
            success: function(data) {
                //关闭加载层
                layer.close(jz);
                if(data.code == 1){
                    swal(data.msg, "", "success");
                    $('#wx_txt').html('');
                    $(':input','#commentWxForm')
//                            .not(':button, :submit, :reset, :hidden')
                            .val('');
//                            .removeAttr('checked')
//                            .removeAttr('selected');
                }else{
                    swal(data.msg, "", "error");
                }

            }
        });

        return false;
    }

    //表单验证
    $(document).ready(function(){
        $(".i-checks").iCheck({checkboxClass:"icheckbox_square-green",radioClass:"iradio_square-green",});
    });
    $.validator.setDefaults({
        highlight: function(e) {
            $(e).closest(".form-group").removeClass("has-success").addClass("has-error")
        },
        success: function(e) {
            e.closest(".form-group").removeClass("has-error").addClass("has-success")
        },
        errorElement: "span",
        errorPlacement: function(e, r) {
            e.appendTo(r.is(":radio") || r.is(":checkbox") ? r.parent().parent().parent() : r.parent())
        },
        errorClass: "help-block m-b-none",
        validClass: "help-block m-b-none"
    });
</script>
</body>
</html>